package com.zy.web.demo.dingshi;

import org.dom4j.DocumentException;
import org.dom4j.Node;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

import java.time.LocalDateTime;
import java.util.List;

import org.dom4j.Document;
import org.dom4j.DocumentHelper;



/**
 * @author <a href="mailto:zhouyong@cqyyt.com">zy</a>
 * @version 1.0
 * @date 2020/10/9 15:06
 */

@Configuration      //1.主要用于标记配置类，兼备Component的效果。
@EnableScheduling   // 2.开启定时任务
public class DingShiDemo {
    //3.添加定时任务
    @Scheduled(cron = "0 00 12 * * ?")
    private void configureTasks() {
        System.err.println("执行静态定时任务时间: " + LocalDateTime.now());
    }

    //3.添加定时任务
    @Scheduled(cron = "0 15 15 * * ?")
    private void configureTask() {
        System.err.println("执行静态定时任务时间: " + LocalDateTime.now());
    }


    private static final String SELECT_PATH = "/response/data/EmrFileContentHtmVos";

//    public static void main(String[] args)
//        Document document;
//        try {
//            document = DocumentHelper.parseText(zy.toString());
//            List<Node> selectNodeList = document.selectNodes(SELECT_PATH);
//            if( selectNodeList != null && selectNodeList.isEmpty() ) {
//                for(Node selectNode : selectNodeList) {
////                    XStream xStream = XStreamUtil.getInstance();
////                    //                    // 使用注解修改对象名称
//                    String[] nodeNameAry = SELECT_PATH.split("/");
////                    xStream.alias(nodeNameAry[nodeNameAry.length - 1], clazz);
////                    data = (T)xStream.fromXML(selectNode.asXML());
//                }
//            }
//        } catch(DocumentException ex) {
//        }
//    }

}